// JavaScript Document
function validate(){
	
	var emp = document.getElementById('txtEmpno');
	var month= document.getElementById('sltMon');
	
	var emps = document.getElementById('txtEmpno').value;
	var months= document.getElementById('sltMon').value;
	
	if(notEmpty(emp, "Employee Number cannot be empty")){
		if(isNumeric(emp, "Employee Number should be numeric ")){
			   if(madeSelection(month, "Select the Month")){
	
	                    var queryString ="?emp=" +  emps  +"&month="+months;
	                    
						window.open("../report/att_emp_report.php"+queryString,'_blank');
	
			              }
			         }
			   }
	}
	
	
	function checkempno(){

 if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
    }
  else
   {// code for IE6, IE5
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     }
    xmlhttp.onreadystatechange=function()
     {
 if (xmlhttp.readyState==4 && xmlhttp.status==200)
  {
									//document.getElementById("ajaxDiv").innerHTML=xmlhttp.responseText; 
									 
   var x=xmlhttp.responseText;
if(x=="false"){
									
  document.getElementById("ajaxDiv1").innerHTML="Invalid Employee No";
  document.getElementById('txtEmpno').value="";
	}else{
  document.getElementById("ajaxDiv1").innerHTML=x; 
									
			}
			}
            }
								
  var y=document.getElementById('txtEmpno').value;
  var queryString ="?empno=" + y;
  xmlhttp.open("GET","../logic/load/check_emp.php"+queryString,true);
  xmlhttp.send();	  
	
	
}